package xiangmu.schoolpaper.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import xiangmu.schoolpaper.pojo.DTO.TeacherSelfPaperScoreDTO;
import xiangmu.schoolpaper.result.Result;
import xiangmu.schoolpaper.service.TeacherSelfPaperScoreService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/teacher/paper-score")
@RequiredArgsConstructor

@Slf4j
@Tag(name="教师端统计分析个人统计概览接口")

public class TeacherSelfPaperScoreController {
    @Autowired
    private final TeacherSelfPaperScoreService teacherSelfPaperScoreService;
    @Operation(summary = "查看最新提交的论文评分情况")
    @GetMapping("one-student")
    public Result getTeacherSelfPaperScore(@RequestParam String studentId) {
        log.info("最新提交的论文评分");
        // 定义一个TeacherSelfPaperScoreDTO类型的变量并赋值
        TeacherSelfPaperScoreDTO teacherSelfPaperScore = teacherSelfPaperScoreService.getTeacherSelfPaperScore(studentId);

        // 打印这个变量
        System.out.println(teacherSelfPaperScore);

        // 返回这个变量
        return Result.success(teacherSelfPaperScore);
    }
}